package com.spicy_clock;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

public class ArchiveActivity extends Activity {

    private ImageButton leftBtn;
    private ImageButton rightBtn;
    private TextView	title;
    private ImageView   titleBar;
    private ImageView	bottombar;
    
    private OnTouchListener archive_listener;
    private OnTouchListener back_listener;
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_archive);
        
        archive_listener = new OnTouchListener()
	{
	    
	    public boolean onTouch(View v, MotionEvent event)
		{
		   if(event.getAction() == MotionEvent.ACTION_DOWN)
		   {
		       leftBtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.videocollectionselected));
		   }
		   else if(event.getAction()==MotionEvent.ACTION_UP)
		   {
		       leftBtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.videocollection));
		       Intent it = new Intent(ArchiveActivity.this,CollectionActivity.class);
		       startActivity(it);
		   }
		    return false;
		}
	};
        
	back_listener = new OnTouchListener()
	{
	    
	    public boolean onTouch(View v, MotionEvent event)
		{
		    if(event.getAction() == MotionEvent.ACTION_DOWN)
			   {
			       rightBtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.backselected));
			   }
		    else if(event.getAction()==MotionEvent.ACTION_UP)
			   {
			       rightBtn.setBackgroundDrawable(getResources().getDrawable(R.drawable.back));
			       Intent it = new Intent(ArchiveActivity.this,MainActivity.class);
			       startActivity(it);
			       
			   }
		    return false;
		}
	};
        leftBtn = (ImageButton)findViewById(R.id.left_videocollection);
        rightBtn = (ImageButton)findViewById(R.id.right_back);
        title = (TextView)findViewById(R.id.title);
        titleBar = (ImageView)findViewById(R.id.titlebar);
        bottombar = (ImageView)findViewById(R.id.bottombar);
        
        leftBtn.setOnTouchListener(archive_listener);
        rightBtn.setOnTouchListener(back_listener);
    }

   
    
    
}
